|
|
|
|
|
|
|
m_MinLength = m_def_MinLength
m_MaxLength = m_def_MaxLength
'
' Required property
m_Required = m_def_Required
'
' Conditional property
m_CheckConditional = m_def_CheckConditional
'
End Sub |
|
|
|
|
|
|
|
|
After updating the InitProperties event, you can add the actual properties Required (Boolean) and CheckConditional (Boolean). Listing 5.41 has the code for the Let and Get methods for these two properties. |
|
|
|
|
|
|
|
|
Listing 5.41. Coding the Let and Get methods for the new properties. |
|
|
|
|
|
|
|
|
Public Property Get Required() As Boolean
Required = m_Required
End Property
Public Property Let Required(ByVal vNewValue As Boolean)
m_Required = vNewValue
PropertyChanged "Required"
End Property
Public Property Get CheckConditional() As Boolean
CheckConditional = m_CheckConditional
End Property
Public Property Let CheckConditional(ByVal vNewValue As Boolean)
m_CheckConditional = vNewValue
PropertyChanged "CheckConditional"
End Property |
|
|
|
|
|
|
|
|
After you've coded the property routines, you can update the WriteProperties event. Listing 5.42 shows the complete code for this event. |
|
|
|
|
|
|
|
|
Listing 5.42. Complete code for the WriteProperties event of the UserControl. |
|
|
|
|
|
|
|
|
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
'
' save design-time property values
' |
|
|
|
|
|